package com.itheima.reggie.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.itheima.reggie.SetmealService;
import com.itheima.reggie.common.ResultInfo;
import com.itheima.reggie.domain.Dish;
import com.itheima.reggie.domain.DishFlavor;
import com.itheima.reggie.domain.Setmeal;
import com.itheima.reggie.domain.SetmealDish;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SetmealController {
    @Autowired
    private SetmealService setmealService;

    //查询套餐菜品
    @GetMapping("/setmeal/list")
    public ResultInfo findBy(Long categoryId,Integer status){
       List<Setmeal>list =setmealService.findBy(categoryId,status);
       return ResultInfo.success(list);
    }

    //套餐菜品展示
    @GetMapping("/setmeal/dish/{id}")
    public ResultInfo jin(@PathVariable("id") Long id){
       List<Dish> setmeal= setmealService.jin(id);
       return ResultInfo.success(setmeal);
    }
}
